<?php $this->load->view('includes/header'); ?>
<div class="container">
    <div class="row">
	   <div class="col-md-9">
		  <h1>Panel de Control <small>Añadir Salas</small></h1>
		  <hr>
		  <?php if (isset($error) && $error): ?>
    		  <div class="alert alert-info alert-dismissable">
    			 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
				<?php
				echo validation_errors();
				if (isset($msg) && $msg != ' ') {
				    echo $msg;
				}
				?>
    		  </div>

		  <?php endif ?>
		  <table class="table table-bordered table-hover tablesorter">
                <thead>
				<tr>
				    <th>Codigo <i class="fa fa-sort"></i></th>
				    <th>Nombre <i class="fa fa-sort"></i></th>
				    <th>Butacas <i class="fa fa-sort"></i></th>
				    <th>Disponible <i class="fa fa-sort"></i></th>
				    <th>Operaciones</th>
				</tr>
                </thead>
                <tbody>
				<?php foreach ($salas as $value): ?>
    				<tr>
				    <td><?php echo $value['cod_salas']; ?></td>
    				    <td><?php echo $value['nombre']; ?></td>
    				    <td><?php echo $value['n_butacas']; ?></td>
				    <td><?php echo ($value['disponible'])? 'SI' : 'NO'; ?></td>
    				    <td>
    					   <a href="<?php echo base_url(); ?>/index.php/salas/add/<?php echo $cod_cine.'/'.$value['cod_salas']; ?>/" title="Editar sala"><i class="fa fa-pencil"></i></a>
    					   <a href="<?php echo base_url(); ?>/index.php/salas/eliminar/<?php echo $cod_cine.'/'.$value['cod_salas']; ?>/" title="Eliminar sala"><i class="fa fa-trash-o"></i></a>
    				    </td>
    				</tr>
				<?php endforeach; ?>
                </tbody>
		  </table>
		  <form role="form" class="form_add" id="form_add_cine" action="<?php echo base_url(); ?>/index.php/salas/add/<?php echo $cod_cine.'/'.$cod_salas; ?>" method="post">

			 <div class="row">
				<div class="form-group col-md-2">
				    <label>CODIGO SALA</label>
				    <input class="form-control" name="cod_salas" value="<?php echo $cod_salas;?>"> 
				</div>
				<div class="form-group col-md-8">
				    <label>NOMBRE</label>
				    <input type="text" class="form-control input_width10" name="nombre" value="<?php echo $nombre; ?>"> 
				</div>
				<div class="form-group col-md-2">
				    <label>Nº BUTACAS</label>
				    <input class="form-control" name="n_butacas" value="<?php echo $n_butacas; ?>"> 
				</div>
				<div class="form-group col-md-2">
				    <label>Disponible</label>
				    <input type="checkbox" class="form-control" name="disponible" value="<?php echo $n_butacas; ?>"> 
				</div>
				<div class="form-group col-md-6">
				    <label>CINE</label>
				    <input class="form-control" name="cod_cine" value="<?php echo $cod_cine; ?> "readonly> 
				</div>
			 </div>

			 <button type="submit" class="btn btn-primary" id="btn_add_client">Enviar</button>
		  </form>
	   </div>
    </div>
</div>



<?php $this->load->view('includes/footer'); ?>